using System.Diagnostics;

namespace iriska
{
    public class LogListener : TraceListener
    {        
        private readonly TextWriterTraceListener _writer;

        public LogListener(string fileName)
        {
            _writer = new TextWriterTraceListener(fileName);
        }

        public override void Write(string message)
        {
            _writer.Write(message);
            _writer.Flush();
        }

        public override void WriteLine(string message)
        {
            _writer.WriteLine(message);
            _writer.Flush();
        }
    }
}